<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
<title>使用预装载图像制作幻灯</title>
<script type="text/javascript">
var j=0;
var test=new Array(15);
for(var i=0;i<=14;i++){
test[i]=i;
}
var test2=[];
for(var i=0;i<test.length;i++){
test2[i]=new Image();
test2[i].src=test[i]+'.gif';
}
function showpic(){
if(j==14)
j=0;
else;
++j;
var imagestr=test2[j].src.split("/");
var imagesrc=imagestr[imagestr.length-1];
str="<img src='image/"+imagesrc+"'/>";
div1.innerHTML=str;
}
</script>
</head>
<body onLoad="var begin=setInterval('showpic()',1000);">
<div id='div1' align="center"></div>
</body>
</html>
